<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Blog And Map - BackOffice</title>


	<!-- Javascript librairies -->
	<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=<?php echo $this->config->item('google_map_key');?>" 	type="text/javascript"></script>
	<script src="<?php echo base_url() ?>javascript/lib/jquery-1.2.6.pack.js" type="text/javascript"></script>
	<script src="<?php echo base_url() ?>javascript/lib/interface.js" type="text/javascript"></script>
	<script src="<?php echo base_url() ?>javascript/lib/jqModal.js" type="text/javascript"></script>
	<script src="<?php echo base_url() ?>javascript/mapFormulaire.js" type="text/javascript"></script>
	<script src="<?php echo base_url() ?>javascript/photoform.js" type="text/javascript"></script>
	
  	<!-- js libraries for uploading photos-->
	<script type="text/javascript" src="<?php echo base_url() ?>javascript/handlers.js"></script>
	<script type="text/javascript" src="<?php echo base_url() ?>javascript/swfupload.js"></script>
	
	<link rel="stylesheet" type="text/css" href="<?php echo base_url() ?>css/reset.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo base_url() ?>css/new_photoform.css" />
</head>
	<body>
		<div id="centerContent">
			<a href="#" onclick="javascript:initialize()"><h1>Add a new note</h1></a>

			<div id="logout"><a href="<?php echo base_url().index_page().'/formulaire/logout'?>">Logout</a></div>
		<?php

		$this->load->helper('form');

		$attributes = array('id' => 'textForm','name' => 'textForm');
		
		echo form_open('',$attributes);

		/*************************
		 * Note fields
		 ************************/
		
		echo '<fieldset><legend>Your trip</legend>';
		echo '<p class="double"><label for="titleForm">Note title :</label>';
		$attributes = array('id' => 'titleForm','name' => 'titleForm');
		echo form_input($attributes,'');
		echo '</p>';
		echo '<p class="double"><label for="tripSelect">Select a trip... :</label>';
		$attributes = array('id' => 'tripSelect','name' => 'tripSelect');
		echo '<select id="tripSelect">';
		foreach($options_trip as $trip){
			echo $trip;
		}
		echo '</select>';
		echo '</p>';
		
		echo '<p class="double"><label for="newTripInput">... or a new one :</label>';
		$attributes = array('id' => 'newTripInput','name' => 'newTripInput');
		echo form_input($attributes);
		echo '</p>';
		
		echo '<p class="double"><label for="tagSelect">Select a tag... :</label>';
		$attributes = array('id' => 'tagSelect','name' => 'tagSelect');
		echo '<select id="tagSelect">';
		foreach($options_tag as $tag){
			echo $tag;
		}
		echo '</select>';
		echo '</p>';

		echo '<p class="double"><label for="bodyForm">Enter your note : </label>';
		$attributes = array('id' => 'bodyForm','name' => 'bodyForm' , 'rows' => '10');
		echo form_textarea($attributes,'');
		echo '</p>';
		echo '<p class="simple">';
		echo '<a href="javascript:validateNote()" id="saveNoteLink">Add this note !</a>';
		echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
		echo '<a href="javascript:geotaggeNote()" id="saveGeoNoteLink">Geotag it !</a>';
		echo '</p>';
		echo '</fieldset>';
		
		/*************************
		 * Geotagging Module
		 ************************/
		
		echo '<fieldset><legend>Geotagging Module</legend>';
		echo '<div id="mapFormulaire"></div>';

		echo '<p class="double"><label for="addressForm">Enter an address : <span class="info">and press enter</span></label>';
		$js = 'onkeydown="if(event.keyCode==13) updateAddressForm()"';
		$attributes = array('id' => 'addressForm','name' => 'addressForm');
		echo form_input($attributes,'',$js);
		echo '</p>';
		echo '</fieldset>';
		echo form_close();


		/*************************
		 * Photo Editor
		 ************************/
		?>
			<fieldset style="width:450px;text-align:center;">
				<legend>Photo Editor</legend>
				<div id="photosuploader">
					<?php if(isset($error)) echo $error;?>

					<span id="selectedPhoto" style="visibility:hidden">
						<img id="seeSelectedPhoto" src=""/><br />
						<button id="geotaggePhoto" onclick="geotaggePhoto()">Geotag</button>
						<button id="deletePhoto" onclick="deletePhoto()">Delete</button>
						<button id="closeSeePhoto" onclick="closeSeePhoto()">Close</button>
					</span>

				</div>

						<button id="btnBrowse" type="button" onclick="selectFiles()">
							Select Images <span style="font-size: 7pt;"></span>
						</button>
					<div id="divFileProgressContainer" style="height: 75px;"></div>
					<!--<div id="thumbnails"></div>-->


					<button id="reloadAlbumButton" onclick="">Reload Album</button>
					<div id="photoAlbum">

					</div>
				</fieldset>
			</div>
		</body>
</html>
